package com.rjjs.Xiaozhi.controller;


import com.rjjs.Xiaozhi.bean.FoodChain;
import com.rjjs.Xiaozhi.service.FoodChainService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/xiaozhi")
@Tag(name = "食品上链")
public class FoodChainController {


    @Autowired
    private FoodChainService foodChainService;

    @PostMapping("/foodchain")
    public int addFood(@RequestBody FoodChain foodChain) throws Exception {
        return foodChainService.addFood(foodChain);
    }



}
